<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;

class CustomRouteServiceProvider extends ServiceProvider
{
    public function boot(Router $router)
    {
        // 加载 admin 目录下的路由文件
//        $adminDirectory = base_path('App/Admin/Routes');
//        $adminFiles = glob($adminDirectory . '/*.php');
//        foreach ($adminFiles as $file) {
//            $router->middleware('api')
//                ->group(function ($router) use ($file) {
//                $router->prefix('admin')->group(function ($router) use ($file) {
//                    require $file;
//                });
//            });
//        }
    }

    public function register()
    {
        // 可以在这里绑定服务到服务容器
    }
}
